package com.zhuss.controller.advice;

import com.zhuss.advice.complaint.ComplaintOperateServiceExt;
import com.zhuss.bean.bo.advice.Complaint.*;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.exception.WpsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/6 9:40
 */
@RestController
@RequestMapping("/complaint")
public class ComplaintOperateController extends BaseController {

    @Autowired
    @Qualifier("complaintOperateService")
    private OperateService<Void, Object> complaintOperateService;

    @Autowired
    @Qualifier("complaintOperateServiceExt")
    private ComplaintOperateServiceExt complaintOperateServiceExt;

    /**
     * 新建
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateComplaintBo bo) throws WpsException {
        complaintOperateService.create(bo);
    }

    /**
     * 修改
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateComplaintBo bo) throws WpsException {
        complaintOperateService.update(bo);
    }

    /**
     * 删除
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteComplaintBo bo) throws WpsException {
        complaintOperateService.delete(bo);
    }

    /**
     * 交办
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/assigned")
    public void assigned(@RequestBody AssignedComplaintBo bo) throws WpsException {
        complaintOperateServiceExt.assigned(bo);
    }

    /**
     * 签收
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/sign")
    public void sign(@RequestBody SignComplaintBo bo) throws WpsException {
        complaintOperateServiceExt.sign(bo);
    }

    /**
     * 回复
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/reply")
    public void reply(@RequestBody ReplyComplaintBo bo) throws WpsException {
        complaintOperateServiceExt.reply(bo);
    }

    /**
     * 处理
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/deal")
    public void deal(@RequestBody DealComplaintBo bo) throws WpsException {
        complaintOperateServiceExt.deal(bo);
    }
}
